<template>
	<view>
				<yk-authpup ref="authPupYk" type="top" @changeAuth="authSuccess" :permissionID="permissionID"></yk-authpup>
	</view>
</template>
<script>

export default {
	name: 'authPopup',
	props: {
		permissionID: {
			type: [String, Number],
			default: 'ACCESS_FINE_LOCATION'
		}
	},
	components: {
	computed: {
	},
	data() {
		return {
			hasPrmissionLocation:false,
		};
	},
	onLoad() {
		 setTimeout(()=>{
			 this.openAuthYk(this.permissionID)
			 },500)
	},
	onReachBottom() {
	},
	methods: {
		// //这个是自己的方法名
		openAuthYk(permissionID){
			setTimeout(()=>{
			    this.permissionID = permissionID;
				this.$refs.authPupYk.open();
			},1000)
		},
		//权限获取后的回调函数
		authSuccess(permissionID){
					this.hasPrmissionLocation = true;		
					_this.$emit('authSuccess',permissionID);
		},
	 // 弹出层显示
	    openPopup() {
	      this.$refs.popup.open();
	    },
	    // 弹出层隐藏
	    closePopup() {
	      this.$refs.popup.close();
	    },
		
	}
};
</script>
